package com.mk.Service.Impl;

import com.mk.Entity.Type;
import com.mk.Entity.queryObject;
import com.mk.Mapper.TypeMapper;
import com.mk.Service.ITypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class TypeServiceImpl implements ITypeService {

    @Autowired
    TypeMapper typeMapper;
    @Override
    public Type queryOne(Long id) {
        return typeMapper.selectOne(id);
    }

    @Override
    public List<Type> queryAll() {
        List<Type> tlist=typeMapper.selectAll();
        return tlist;
    }

    @Override
    public List<Type> queryAllLimit(queryObject queryObject) {
        List<Type> typeList = typeMapper.selectAllLimit(queryObject);
        return typeList;
    }

    @Override
    public void insertType(Type type) {
        typeMapper.insert(type);
    }

    @Override
    public void deleteType(Long id) {
        typeMapper.delete(id);
    }

    @Override
    public void updateType(Type type) {
        typeMapper.update(type);
    }

    @Override
    public Integer queryCount() {
        Integer count=typeMapper.selectCount();
        return count;
    }
}
